<template>
  <div class="c-bg-sgray">
    <div class="c-bg-white" v-if="answerInfo != null" ref="answerBg">
      <div>
        <img class="c-w100 c-h" src="../../../assets/i/wap/qa/qa_bg.jpg" alt="">
      </div>
      <div class="c-flex-column">
        <div @click="isShow = !isShow">
          <div class="c-flex-row c-ph24 c-pb30">
            <div class="c-ww140 c-hh140 c-brp50 c-p c-bd2-white">
              <img class="c-w100 c-h c-brp50" v-lazy="answerInfo.avatar || require('@/assets/defult_head.png')" alt="">
            </div>
            <div class="c-ml10 c-flex-column c-justify-sb c-mt6">
              <div class="c-flex-row c-p c-maxw c-aligni-center">
                <span class="c-fs30 c-fc-xblack c-fw600">{{answerInfo.name}}</span>
              </div>
              <div class="c-flex-row" v-if="(answerInfo.price * 1 > 0 && ((answerInfo.vipDiscountType == 1 && answerInfo.vipDiscount < 100) || (answerInfo.vipDiscountType == 2 && Number(answerInfo.vipDiscountPrice) < Number(answerInfo.price))) || (answerInfo.price * 1 > 0 && ((answerInfo.vipDiscountType == 1 && answerInfo.svipDiscount < 100) || (answerInfo.vipDiscountType == 2 && Number(answerInfo.svipDiscountPrice) < Number(answerInfo.price)))))">
                <div v-if="answerInfo.price * 1 > 0 && ((answerInfo.vipDiscountType == 1 && answerInfo.vipDiscount < 100) || (answerInfo.vipDiscountType == 2 && Number(answerInfo.vipDiscountPrice) < Number(answerInfo.price)))" class="c-fs20 c-ph10 c-bg-xmlred-5 c-fc-xmlred c-br10 c-pv4 c-mr20">
                  <span>VIP<span v-if="(answerInfo.vipDiscountType == 1 && answerInfo.vipDiscount > 0) || (answerInfo.vipDiscountType == 2 && Number(answerInfo.vipDiscountPrice) > 0)">{{'￥' | iosPriceFilter('Question')}}</span>{{(answerInfo.vipDiscountType == 1 && answerInfo.vipDiscount == 0) || (answerInfo.vipDiscountType == 2 && Number(answerInfo.vipDiscountPrice) == 0) ? '免费' : answerInfo.vipDiscountType == 2 ? Number(answerInfo.vipDiscountPrice).toFixed(2) : Number(answerInfo.vipDiscount * answerInfo.price / 100).toFixed(2)}}</span>
                </div>
                <div v-if="answerInfo.price * 1 > 0 && ((answerInfo.vipDiscountType == 1 && answerInfo.svipDiscount < 100) || (answerInfo.vipDiscountType == 2 && Number(answerInfo.svipDiscountPrice) < Number(answerInfo.price)))" class="c-fs20 c-ph10 c-bg-xmlred-5 c-fc-xmlred c-br10 c-pv4">
                  <span>SVIP<span v-if="(answerInfo.vipDiscountType == 1 && answerInfo.svipDiscount > 0) || (answerInfo.vipDiscountType == 2 && Number(answerInfo.svipDiscountPrice) > 0)">{{'￥' | iosPriceFilter('Question')}}</span>{{(answerInfo.vipDiscountType == 1 && answerInfo.svipDiscount == 0) || (answerInfo.vipDiscountType == 2 && Number(answerInfo.svipDiscountPrice) == 0) ? '免费' : answerInfo.vipDiscountType == 2 ? Number(answerInfo.svipDiscountPrice).toFixed(2) : Number(answerInfo.svipDiscount * answerInfo.price / 100).toFixed(2)}}</span>
                </div>
              </div>
              <div class="c-flex-row c-aligni-center">
                <div class="theme-fc theme-bg-10 c-fs20 c-br6 c-ph8 c-pv4 c-textAlign-c c-ws-n c-maxw200 c-text-ellipsis1">{{answerInfo.honor}}</div>
                <div class="c-fc-gray c-fs20 c-ml10" v-if="answerInfo != null && answerInfo.originalPrice != null">
                  <span v-if="answerInfo.originalPrice * 1 > 0">{{'￥' | iosPriceFilter('Question')}}</span>{{answerInfo.originalPrice * 1 == 0 ? `免费${questionCustom == 1 ? '预约' : '提问'}` : `${answerInfo.originalPrice}提问`}}
                </div>
              </div>
            </div>
          </div>
          <div class="c-flex-row c-aligni-center c-ph24 c-pb30" v-if="answerInfo.intro">
            <div class="c-text-ellipsis1 c-p c-fs24 c-fc-gray c-flex-grow1">
              {{answerInfo.intro}}
            </div>
            <div class="iconfont c-fs18 c-fc-gray">
              &#xe635;
            </div>
          </div>
        </div>
        <div class="c-pb30" v-if="isAnswererSelf == 0">
          <div class="c-hh60 c-lh60 c-mh24">
            <div v-if="vipType == 2 && answerInfo.price * 1 > 0 && ((answerInfo.vipDiscountType == 1 && answerInfo.vipDiscount < 100) || (answerInfo.vipDiscountType == 2 && Number(answerInfo.vipDiscountPrice) < Number(answerInfo.price)))" class="c-h c-fc-white theme-bg c-br32 c-textAlign-c c-fs24 c-flex-row c-flex-center" @click="goAsk">
              <span v-if="(answerInfo.vipDiscountType == 1 && answerInfo.vipDiscount > 0) || (answerInfo.vipDiscountType == 2 && Number(answerInfo.vipDiscountPrice) > 0)">{{'￥' | iosPriceFilter('Question')}}</span>{{answerInfo.freeCount * 1 > 0 ? `免费${questionCustom == 1 ? '预约' : '提问'}${answerInfo.freeCount}次` : ((answerInfo.vipDiscountType == 1 && Number(answerInfo.vipDiscount * answerInfo.price / 100) > 0) || (answerInfo.vipDiscountType == 2 && answerInfo.vipDiscountPrice > 0)) ? `${answerInfo.vipDiscountType == 1 ? Number(answerInfo.vipDiscount * answerInfo.price / 100).toFixed(2) : Number(answerInfo.vipDiscountPrice).toFixed(2)}${questionCustom == 1 ? '预约' : '提问'}` : `免费${questionCustom == 1 ? '预约' : '提问'}`}}
            </div>
            <div v-else-if="vipType == 4 && answerInfo.price * 1 > 0 && ((answerInfo.vipDiscountType == 1 && answerInfo.svipDiscount < 100) || (answerInfo.vipDiscountType == 2 && Number(answerInfo.svipDiscountPrice) < Number(answerInfo.price)))" class="c-h c-fc-white theme-bg c-br32 c-textAlign-c c-fs24 c-flex-row c-flex-center" @click="goAsk">
              <span v-if="(answerInfo.vipDiscountType == 1 && answerInfo.svipDiscount > 0) || (answerInfo.vipDiscountType == 2 && Number(answerInfo.svipDiscountPrice) > 0)">{{'￥' | iosPriceFilter('Question')}}</span>{{answerInfo.freeCount * 1 > 0 ? `免费${questionCustom == 1 ? '预约' : '提问'}${answerInfo.freeCount}次` : ((answerInfo.vipDiscountType == 1 && Number(answerInfo.svipDiscount * answerInfo.price / 100) > 0) || (answerInfo.vipDiscountType == 2 && answerInfo.svipDiscountPrice > 0)) ? `${answerInfo.vipDiscountType == 1 ? Number(answerInfo.svipDiscount * answerInfo.price / 100).toFixed(2) : Number(answerInfo.svipDiscountPrice).toFixed(2)}${questionCustom == 1 ? '预约' : '提问'}` : `免费${questionCustom == 1 ? '预约' : '提问'}`}}
            </div>
            <div v-else class="c-h c-fc-white theme-bg c-br32 c-textAlign-c c-fs24 c-flex-row c-flex-center" @click="goAsk">
              <span v-if="answerInfo.price * 1 > 0">{{'￥' | iosPriceFilter('Question')}}</span>{{answerInfo.freeCount * 1 > 0 ? `免费${questionCustom == 1 ? '预约' : '提问'}${answerInfo.freeCount}次` : answerInfo.price * 1 > 0 ? `${answerInfo.price}${questionCustom == 1 ? '预约' : '提问'}` : `免费${questionCustom == 1 ? '预约' : '提问'}`}}
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- 圈子推荐 -->
    <div class="c-pt30" v-if="circleList && circleList.length > 0">
      <div class="c-fs28 c-fw600 c-fc-xblack c-ph24">答主入驻圈子</div>
      <div class="c-w100 c-ph24 c-pt24 c-contexty-hidden c-contextX-scroll c-flex-row c-ws-n">
        <div class="c-flex-shrink0 c-ww332 c-hh136 c-flex-row c-pv20 c-ph20 c-boxSizing-b c-bg-white c-br20" @click="handleClickCircle(item.circleId)" :class="index == circleList.length - 1 ? '' : 'c-mr20'" v-for="(item, index) in circleList" :key="index">
          <img :src="$addXossFilter(item.avatar || require('@/assets/defult270.png'))" class="c-ww96 c-hh96 c-br10" alt="">
          <div class="c-pl12 c-flex-column c-justify-sb c-flex-grow1 c-w0 c-bg-white">
            <div class="c-fs24 c-text-ellipsis1 c-fc-xblack c-mb6">{{item.name}}</div>
            <div class="c-fs24 c-fc-xmlred c-fw600" v-if="item.payType == 1">免费</div>
            <div class="c-fs24 c-fc-xmlred c-fw600" v-else-if="item.payType == 4">配套课程</div>
            <div class="c-fs24 c-fc-xmlred c-fw600" v-else-if="item.payType == 3">加密</div>
            <div class="c-fc-xmlred c-fw600 c-lh" :class="Number(item.price) == 0 ? 'c-fs22':'c-fs24'" v-else>
              <span>{{'￥' | iosPriceFilter}}</span>{{item.price | moneyStr}}
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- 圈子推荐 -->
    <div class="c-flex-row c-justify-sb c-aligni-center c-ph24 c-pt30 c-p">
      <div class="c-fs28 c-fw600 c-fc-xblack">相关{{questionCustom == 1 ? '预约' : '提问'}}</div>
      <div class="c-fs22 c-fc-gray">
        <span class="theme-fc">{{solutionCount}}</span> 回答
        <span v-if="circuseeCount * 1 > 0 && isShowNum == 1"> &nbsp; / &nbsp;
          <span class="theme-fc">{{circuseeCount}}</span> 围观
        </span>
      </div>
    </div>
    <div>
      <div class="c-bg-sgray">
        <qa-list :bindPhoneSetting="bindPhoneSetting" :list="questionList" :fromType="4" :isDirect="1" class="c-ph24" :playAduioSrc="playAduioSrc" @clickPreviewImage="clickPreviewImage" @clickPlayAudio="clickPlayAudio" @clickShowVideo="clickShowVideo"></qa-list>
      </div>
      <audio id="audio" @ended="playAudioEnd" class="c-pf c-p-l-100"></audio>
      <video-popup :showVideo="showVideo" @clickCloseVideo="clickCloseVideo" :videoSrc="currentVideoObj.videoSrc" :m3u8Url="currentVideoObj.m3u8Url"></video-popup>
      <loading-status-tem noDataStyle="padding-top: 0;" :class="dataStatus == 'NO_DATA' ? 'c-bg-white c-mh24 c-mt30 c-hh552 c-flex-column c-flex-center c-br20' : ''" :dataStatus="dataStatus" noDataTextClass="c-fs24 c-fc-sgray" :noDataText="'暂无相关回答'" :noneImage="noneImage"></loading-status-tem>
    </div>
    <div class="c-maxw640 c-w100 c-hh80 c-lh80 c-ph24 c-pf c-pz1 c-p-b0 c-flex-row c-justify-sa c-aligni-center c-fs20 c-fc-sblack c-bg-white c-pv30 c-box-shadow-bottom">
      <div class="c-ww160 c-hh48 c-lh48 c-flex-row c-flex-center c-fs24 c-fc-xblack" @click="clickGoQA">
        <span class="iconfont theme-fc c-mr12">&#xe6c2;</span>
        {{questionCustom == 1 ? '预约' : '问答'}}专区
      </div>
      <span class="c-fc-f6">|</span>
      <div class="c-ww160 c-hh48 c-lh48 c-textAlign-c c-flex-row c-flex-center c-fs24 c-fc-xblack" @click="clickGoMy" v-if="userIdentity != 4">
        <span class="iconfont theme-fc c-mr12">&#xe6c3;</span>
        我的{{questionCustom == 1 ? '预约' : '问答'}}
      </div>
    </div>
    <cj-popup v-model="isShow" round position="bottom" @closed="closeModal" class="changeline-popup personInfo">
      <div class="c-w100 c-flex-column c-pz1 c-pb20 c-br-tl20 c-br-tr20 c-p" v-if="answerInfo">
        <div class="c-pv20 c-p c-bg-white">
          <div class="c-fs28 c-fw600 c-textAlign-c">个人简介</div>
          <div class="iconfont c-fs20 c-fc-gray c-pa  c-p-r24 c-p-t30 c-pz10" @click="closeModal">&#xe61b;</div>
        </div>
        <div class="c-ph24 c-content-scroll c-maxh800">
          <div class="c-br20 c-ph24 c-pt30 c-pb48 c-bg-white c-mt30">
            <div class="c-ww100 c-hh100 c-brp50 c-center">
              <img class="c-w100 c-h c-brp50" v-lazy="answerInfo.avatar || require('@/assets/defult_head.png')" alt="">
            </div>
            <div class="c-fs30 c-fc-xblack c-fw600 c-textAlign-c c-mt6">{{answerInfo.name}}</div>
            <div class="c-mt30 c-fs24 c-fw600 c-fc-xblack" v-if="answerInfo.honor">答主头衔</div>
            <div class="c-fs24 c-mt10 c-fc-gray" v-if="answerInfo.honor">{{answerInfo.honor}}</div>
            <div class="c-mt30 c-fs24 c-fw600 c-fc-xblack" v-if="answerInfo.intro">答主简介</div>
            <div class="c-fs24 c-mt10 c-fc-gray" v-if="answerInfo.intro">{{answerInfo.intro}}</div>
          </div>
          <div class="c-br20 c-ph24 c-pt30 c-pb28 c-bg-white c-mt30">
            <div class="c-fs24 c-fw600 c-fc-xblack">问答服务</div>
            <div class="c-flex-row c-aligni-center c-mt24">
              <div class="c-flex-row c-aligni-center">
                <div class="c-fs24 c-fc-gray">
                  总回答
                </div>
                <div class="theme-fc c-fs28 c-ml10">{{statusCount.solutionCount|formatTenThousand}}</div>
              </div>
              <div class="c-flex-row c-aligni-center c-ml60">
                <div class="c-fs24 c-fc-gray">
                  今日回答
                </div>
                <div class="theme-fc c-fs28 c-ml10">{{statusCount.todayCount|formatTenThousand}}</div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </cj-popup>
  </div>
</template>
<script>
import loadingStatusTem from "@/components/templates/common/loadingStatusTem.vue";
import { utilJs, wxUtilJs } from "@/utils/common.js";
import QaList from "@/components/templates/qa/qaList.vue";
import videoPopup from "@/components/templates/common/videoPopup.vue";
import { getBindPhoneSetting } from "@/utils/checkUnBindPhone.js";
let answerId = "";
let pageIndex = 1;
let isPlayTest = false; //是否试听
let currentLocalId = ""; //当前录制本地音频ID
let curPlayLocalId = ""; //当前播放本地音频ID
const PAGE_SIZE = 10;
export default {
  name: "AswerCircuseeList",
  components: {
    loadingStatusTem,
    QaList,
    videoPopup
  },
  created() {
    utilJs.appShare(this);
  },
  data() {
    return {
      noneImage: 'https://ck-bkt-knowledge-payment.oss-cn-hangzhou.aliyuncs.com/admin/material/9_material_admin/image/assets/i/wap/qa/qaNoneData.png',
      theme: localStorage.getItem("colorName")
        ? localStorage.getItem("colorName")
        : "mb5_default",
      isShowNum: '',
      companyAuth: '',
      problemStatus: '',
      questionCustom: '',
      questionInfo: '',
      questionList: [],
      dataStatus: 'HAS_MORE_DATA',
      circuseeCount: 0, //围观次数
      solutionCount: 0, //回答次数
      showVideo: false,
      playAduioSrc: "", //播放音频地址
      isPlayingAudio: false,
      answerInfo: null,
      statusCount: null,
      isShowTip: false,
      isShowMore: false,
      isAnswererSelf: '', //自身是否是答主 0否 1是
      userIdentity: '', //1答主2提问者3围观者4都不是
      currentVideoObj: {},
      expande: false, //展开 收起
      needShowExpande: false, //超3行显省略号和文字
      circleList: [],
      bindPhoneSetting: null,
      vipType: localStorage.getItem("vipType" + localStorage.getItem("userId")),
      isShow:false
    };
  },
  beforeRouteEnter(to, from, next) {
    next(vm => {
      answerId = vm.$route.query.answerId;
      if (from.path != "/homePage/login/bindMobile") {
        // 不是从绑定手机号页面来
        // if (localStorage.getItem('enableBindPhoneEnterBeforeInQuestion') == 1 && localStorage.getItem('uMobile') == '') {
        //   vm.$routerGo(vm, "push", {
        //     path: '/homePage/login/bindMobile'
        //   })
        // } else {
          pageIndex = 1;
          vm.getAswerQueList()
        // }
      } else {
        // 从绑定手机页面来,手机号为空 即返回
        // if (localStorage.getItem('enableBindPhoneEnterBeforeInQuestion') == 1 && localStorage.getItem('uMobile') == '') {
        //   vm.$routerGo(vm, "push", { path: "/" });
        // } else {
          // 从绑定手机页面来,手机号存在 即绑定成功 跳问答专区
          vm.$routerGo(vm, "push", {
            path: '/homePage/qa/aswerCircuseeList',
            query: {
              answerId: answerId,
            }
          })
          vm.getAswerQueList()
        // }
      }
    });
  },
  mounted() {
    window.addEventListener('scroll', this.scrollHandle); //绑定页面滚动事件
  },
  methods: {
    closeModal() {
      this.isShow = false
    },
    handleClickCircle(circleId) {
      this.$routerGo(this, "push", {
        path: "/homePage/circle/circleFeed",
        query: {
          id: circleId
        }
      })
    },
    //获取已回答问题列表
    getAswerQueList() {
      if (this.dataStatus == 'LOADING') {
        return;
      }
      this.dataStatus = 'LOADING';
      utilJs.getMethod(
        global.apiurl +
        "question/getAnswerSolution?answerId=" +
        answerId +
        "&limit=" +
        PAGE_SIZE +
        "&page=" +
        pageIndex,
        res => {
          this.solutionCount = res.solutionCount;
          this.circuseeCount = res.circuseeCount;
          this.answerInfo = res.answerInfo;
          this.isAnswererSelf = res.answerInfo.isAnswererSelf;
          this.circleList = res.circleList;
          this.userIdentity = res.userIdentity;
          this.statusCount = res.statusCount
          if (res.answerInfo.status != 1) {
            //答主下线或被删除
            this.$routerGo(this, "push", {
              path: "/homePage/qa/answerLord"
            })
          }
          if (pageIndex == 1) {
            this.questionList = res.questionList.data;
          } else {
            let list = res.questionList.data;
            this.questionList = this.questionList.concat(list);
          }
          if (res.questionList.to * 1 == res.questionList.total * 1) {
            this.dataStatus = pageIndex == 1 && res.questionList.data.length == 0 ? 'NO_DATA' : 'NO_MORE_DATA';
          } else {
            this.dataStatus = 'HAS_MORE_DATA';
            pageIndex++;
          }
          this.wechatShare();
        },
        failRes => {
          this.dataStatus = 'DATA_ERROR';
        }
      );
    },

    //点击图片放大预览
    clickPreviewImage(imgUrl, itemImgList, questionStatus) {
      if (questionStatus == -1) {
        return;
      }
      if (!imgUrl || imgUrl == "upload") {
        return;
      }
      let imgUrlList = [];
      for (let key of itemImgList) {
        if (key) {
          imgUrlList.push(key);
        }
      }

      wxUtilJs.previewImage({
        current: imgUrl, // 当前显示图片的http链接
        urls: imgUrlList // 需要预览的图片http链接列表
      });
    },


    //点击问答专区
    clickGoQA() {
      this.$routerGo(this, "push", {
        path: "/homePage/qa/answerLord"
      });
    },
    clickGoMy() {
      localStorage.setItem("fromCircuseeList", 1);
      let userType = this.userIdentity == 1 ? 2 : this.userIdentity == 2 ? 1 : 3;
      this.$routerGo(this, "push", {
        path: "/homePage/qa/myQA",
        query: {
          userType: userType,
        }
      });
    },
    goAsk() {
      if ((this.answerInfo.price * 1 > 0 && this.bindPhoneSetting && this.bindPhoneSetting.buyBind) || (this.answerInfo.price * 1 == 0 && this.bindPhoneSetting && this.bindPhoneSetting.getBind)) {
        if (utilJs.goBindMobile()) return;
      }
      this.$routerGo(this, "push", {
        path: "/homePage/qa/questionDetail",
        query: {
          answerId: this.answerInfo.answerId,
          src: 1,
          goAsk: 1,
        }
      })
    },
    //停止试听
    stopListenAudio() {
      if (isPlayTest) {
        wxUtilJs.stopVoice({ localId: currentLocalId });
        isPlayTest = false;
      } else {
        wxUtilJs.stopVoice({ localId: curPlayLocalId });
      }
    },
    //点击播放音频
    clickPlayAudio(audioUrl, questionStatus) {
      if (questionStatus == -1) {
        return
      }
      let audio = document.getElementById("audio");
      if (this.playAduioSrc == audioUrl) {
        this.playAduioSrc = "";
        document.getElementById("audio").src = this.playAduioSrc;
        this.stopListenAudio();
        return;
      }
      this.playAduioSrc = audioUrl;
      this.isPlayTest = false;

      //返回mp3则用audio播放，否则将使用微信将文件下载然后播放
      if (this.playAduioSrc) {
        document.getElementById("audio").src = this.playAduioSrc;
        audio.play();
      }
      this.isPlayingAudio = true;
    },
    //监听音频播放结束执行的内容
    playAudioEnd() {
      //播放结束自动播放下一个非自己发的语音并且非已读语音
      this.playAduioSrc = "";
      document.getElementById("audio").src = this.playAduioSrc;
      this.isPlayingAudio = false;
    },
    //点击显示视频
    clickShowVideo(isReply, questionStatus, videoSrc, m3u8Url) {
      if (questionStatus == -1) {
        return;
      }
      if (this.isPlayingAudio == true) {
        this.playAudioEnd();
      }
      this.showVideo = true;
      this.currentVideoObj = {videoSrc, m3u8Url}
    },
    //点击关闭视频
    clickCloseVideo() {
      if (this.showVideo) {
        this.showVideo = false;
      }
    },
    //分享
    wechatShare: function () {
      let title = `【邀请您来提问】 ${this.answerInfo.name}`;
      let shareImg = this.answerInfo.avatar;
      let shareUrl = `${window.location.href.split("#")[0]}#${this.$route.path}?refereeId=${localStorage.getItem("userId")}&answerId=${answerId}`;
      let shareDesc = this.answerInfo.intro;
      utilJs.wechatConfig(
        shareUrl,
        title,
        shareImg,
        shareDesc,
        function () { },
        true
      );
    },
    //手机端分享
    appShare() {
      let title = `【邀请您来提问】 ${this.answerInfo.name}`;
      let shareImg = this.answerInfo.avatar;
      let shareUrl = `${window.location.href.split("#")[0]}#${this.$route.path}?refereeId=${localStorage.getItem("userId")}&answerId=${answerId}`;
      let shareDesc = this.answerInfo.intro;
      utilJs.appShareTrue(title, shareImg, shareUrl, shareDesc);
    },
    windowScrollFunction() {
      utilJs.handleLoading(() => {
        if (this.dataStatus == 'HAS_MORE_DATA' && this.questionList.length > 0) {
          this.getAswerQueList();
        }
      });
    },
  },
  activated() {
    setDocumentTitle("答主详情");// eslint-disable-line
    if ((this.problemStatus && this.problemStatus.status == -1) || (this.companyAuth && this.companyAuth.enableQuestionModule == -1)) {
      this.$routerGo(this, "replace", {
        path: "/error/emptyPage",
        query: {
          info: "问答已下架"
        }
      });
    }
    answerId = this.$route.query.answerId;
    pageIndex = 1;
    this.isShowNum = localStorage.getItem('questionInfo') && localStorage.getItem('questionInfo') != 'undefined' ? JSON.parse(localStorage.getItem('questionInfo'))['isShowNum'] : {};
    this.companyAuth = localStorage.getItem("companyAuth") ? JSON.parse(localStorage.getItem("companyAuth")) : {};
    this.problemStatus = localStorage.getItem("questionInfo") && localStorage.getItem('questionInfo') != 'undefined' ? JSON.parse(localStorage.getItem("questionInfo")) : {};
    this.questionCustom = localStorage.getItem("questionCustom");
    this.questionInfo = localStorage.getItem("questionInfo") && localStorage.getItem('questionInfo') != 'undefined' ? JSON.parse(localStorage.getItem("questionInfo")) : {};
    this.isPublic = 1;
    this.questionDesc = "";
    this.anonymous = false; //是否匿名
    this.uploadImgList = ["upload"]; //上传的图片列表
    this.questionList = [];
    this.circleList = [];
    this.showVideo = false;
    this.answerInfoHeigh = 0;
    this.playAduioSrc = "";
    this.isAnswererSelf = "";
    this.userIdentity = "";
    isPlayTest = false;
    this.isShowTip = false;
    this.isShowMore = false;
    this.expande = false;
    this.needShowExpande = false;
    this.answerInfo = null
    currentLocalId = "";
    curPlayLocalId = "";
    this.dataStatus = 'HAS_MORE_DATA';
    this.isPlayingAudio = false;
    this.isShowBottomBar = false;
    this.circuseeCount = 0; //围观次数
    this.solutionCount = 0; //回答次数
    getBindPhoneSetting(global.ckFrom.qa).then(res => {
      this.bindPhoneSetting = res;
    });
    // this.getAswerQueList();
    window.addEventListener('scroll', this.windowScrollFunction);
  },
  beforeDestroy() {
    window.removeEventListener('scroll', this.windowScroll)
  },
  deactivated() {
    this.dataStatus = 'NO_MORE_DATA';
    this.playAduioSrc = "";
    if (document.getElementById("audio")) {
      document.getElementById("audio").src = '';
    }
    window.removeEventListener('scroll', this.windowScrollFunction);
  }
};
</script>
<style scoped>
textarea {
  resize: none;
  line-height: 0.85rem;
}
textarea::-webkit-input-placeholder {
  /* WebKit browsers */
  color: #ccc;
}
.fc-dblue {
  color: #436AB0;
}
.answerBg {
  background-image: url("../../../assets/i/wap/qa/answerBg.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.mw132 {
  min-width: 3.3rem;
}
.p-b-6 {
  bottom: -0.15rem;
}
.fc-llgreen {
  color: #71DB78
}
.bd1-llgreen{border:1px solid #71DB78;}
.fc-lgreen {
  color: #6DDC73;
}
.spacing0{
  letter-spacing:0;
}
.hhAtuto {
  height: auto;
}
.bs-white {
  box-shadow: -22px 0px 0px 0px rgba(255,255,255,0.5);
}
.c-fc-f6 {
  color: #f6f6f6;
}
.left100p {
 left: 100%
}
.personInfo{
  background: #F5F7FA;
}
</style>


